<?php

$dossierObject=R::findOne("portal_objects","name=?",array("cabinet_dossier"));



$fields=R::findAll("portal_tables_fields","objectId = ? ORDER BY orderCmpnt ASC",array($dossierObject->id));
?>
<form action="/butterflyportal/" method="POST" >
<input type="hidden" name="table" value="cabinet_dossier"/>
<table class="ewTable ButterflyPortal-main" summary="cabinet_dossier">
<tbody>
<?php 
$i=0;
foreach ($fields as $field)
{
	$options=$field->options_value;
	

	if (stristr($options, 'L')){
$fieldname=strtoupper($field->fieldname);
$fieldlib=strtoupper($field->lib_FR);
?>
<tr class="ewTableRow ButterflyPortal-row-0">
<td class="ewTableHeader ButterflyPortal-key-0"><?=$fieldlib?></td>
<td class="ButterflyPortal-value-0"><span id="el_<?=$fieldname?>">
<?php 
if ($field->values_table==""){

?>
<input class="ButterflyPortal-input-0" type="text" name="ButterflyPortal_sys_qf<?=$i?>" id="ButterflyPortal_data_<?=$fieldname?>" value="" size="50" maxlength="50" data-ovi-hasaddedvoiceinputfunction="true" x-webkit-speech="" speech="" lang="fr-FR">
<?php }
else{
	makeSelect("ButterflyPortal_sys_qf".$i,"",$field->values_description,$field->values_description,$field->values_table,$field->values_filters,"");

}
?>
</span></td>
</tr>

<?php 
}
$i++;
}

?>



</tbody></table>
<br/>
<input type="submit" value='Rechercher'>  

</form>